#! /bin/bash
# Program:
#    Start the e2d_node

if [ $# -lt 1 ]
then
   echo -e "Please specify the config file path:\n" \
	"Usage: startnode config_file"
   exit 0
fi

base="`dirname $(which "$0")`/.."
ROOTDIR=`(cd "$base"; echo $PWD)`

export E2D_ROOT=$ROOTDIR
export E2D_CONF_PATH=$ROOTDIR/conf
#echo $E2D_CONF_PATH

erl +K true \
    +A 32 \
    +W w \
    -pa ./ebin ./conf \
    -config $1 \
    -mnesia dir '"/var/e2dynamo/mnesia"'  \
    -s e2d 
